package com.cdshangpai.photoapp.ui;

import android.view.View;
import android.view.ViewGroup;

import androidx.constraintlayout.widget.ConstraintLayout;

import com.cdshangpai.utils.system.ScreenParams;

public class ViewMarginAdjust {
    /**
     * 调整列表试图边距
     * @param view
     */
    public static void adjustListPosition(View view)
    {
        ViewGroup.LayoutParams lp=view.getLayoutParams();

        ConstraintLayout.LayoutParams clp=(ConstraintLayout.LayoutParams)lp;
        clp.leftMargin= ScreenParams.listMargin;
        clp.rightMargin=ScreenParams.listMargin;
        clp.bottomMargin=ScreenParams.listBottomMargin;
        view.setLayoutParams(clp);
    }
}
